<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout"
      layout:decorator="share/layout">
<head>
    <meta charset="UTF-8"/>
    <title>Title</title>

</head>
<body>
<div layout:fragment="content" style="width:96%;margin-left:auto;margin-right:auto;">
    <form action="/user/loginP" method="post">
        <input type="text" id="name" name="name" />
        <input type="text" id="pwd" name="pwd" />
    12345
        <input type="button" value="登 录"/>
    </form>
</div>
<script layout:fragment="script" type="text/javascript">
    /*<![CDATA[*/
    $('input[type=button]').click(function () {
        var name=$('#name').val(),pwd=$('#pwd').val();
        $.post("loginP",{name:name,pwd:pwd},function(r){
            if(r.code < 0){ alert(r.msg);}
            else location.href="/blog/list0";
        });
    });
    /*]]>*/
</script>
</body>
</html>